package com.lifeng.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Created by lifeng on 2019/5/27.
 */
@RestController
public class UserController {
    private static final Logger log = LoggerFactory.getLogger(UserController.class);
    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping("/info")
    public String getInfo(){
        String callServiceResult = restTemplate.getForEntity("http://service-nacos-provider/info",String.class).getBody();
        return callServiceResult;
    }
}
